

#ifndef UC_GECURV2D_H
#define UC_GECURV2D_H

#include "zadesk.h"
#include "zgeent2d.h"
#include "zgeponc2d.h"
#include "zgept2dar.h"
#include "zgevc2dar.h"
#include "zgedblar.h"
#include "zgevptar.h"
#include "zgeintarr.h"
#pragma pack (push, 8)

class UcGePoint2d;
class UcGeVector2d;
class UcGePointOnCurve2d;
class UcGeInterval;
class UcGeMatrix2d;
class UcGeLine2d;
class UcGePointOnCurve2dData;
class UcGeBoundBlock2d;

class
GE_DLLEXPIMPORT
UcGeCurve2d : public UcGeEntity2d
{
public:

    void           getInterval(UcGeInterval& intrvl) const;
    void           getInterval(UcGeInterval& intrvl, UcGePoint2d& start,
			                   UcGePoint2d& end) const;
    UcGeCurve2d&   reverseParam();
	UcGeCurve2d&   setInterval();
	ZSoft::Boolean setInterval(const UcGeInterval& intrvl);

    double         distanceTo(const UcGePoint2d& pnt,
                              const UcGeTol& = UcGeContext::gTol) const;
    double         distanceTo(const UcGeCurve2d&,
                              const UcGeTol& tol = UcGeContext::gTol) const;

    UcGePoint2d closestPointTo(const UcGePoint2d& pnt,
                               const UcGeTol& tol = UcGeContext::gTol) const;
    UcGePoint2d closestPointTo(const UcGeCurve2d& curve2d,
                               UcGePoint2d& pntOnOtherCrv,
                               const UcGeTol& tol= UcGeContext::gTol) const;

    void getClosestPointTo(const UcGePoint2d& pnt,
                           UcGePointOnCurve2d& pntOnCrv,
                           const UcGeTol& tol = UcGeContext::gTol) const;
    void getClosestPointTo(const UcGeCurve2d& curve2d,
                           UcGePointOnCurve2d& pntOnThisCrv,
                           UcGePointOnCurve2d& pntOnOtherCrv,
                           const UcGeTol& tol = UcGeContext::gTol) const;

    ZSoft::Boolean getNormalPoint (const UcGePoint2d& pnt,
	                           UcGePointOnCurve2d& pntOnCrv,
                                   const UcGeTol& tol = UcGeContext::gTol) const;

    ZSoft::Boolean isOn(const UcGePoint2d& pnt,
                        const UcGeTol& tol = UcGeContext::gTol) const;
    ZSoft::Boolean isOn(const UcGePoint2d& pnt, double& param,
                        const UcGeTol& tol = UcGeContext::gTol) const;
    ZSoft::Boolean isOn(double param,
                        const UcGeTol& tol = UcGeContext::gTol) const;

    double         paramOf(const UcGePoint2d& pnt,
                           const UcGeTol& tol = UcGeContext::gTol) const;

	void           getTrimmedOffset (double distance,
									 UcGeVoidPointerArray& offsetCurveList,
									 UcGe::OffsetCrvExtType extensionType = UcGe::kFillet,
                                     const UcGeTol& = UcGeContext::gTol) const;

    ZSoft::Boolean isClosed  (const UcGeTol& tol = UcGeContext::gTol) const;
    ZSoft::Boolean isPeriodic(double& period) const;
    ZSoft::Boolean isLinear  (UcGeLine2d& line,
                              const UcGeTol& tol = UcGeContext::gTol) const;

    double         length       (double fromParam, double toParam,
                                 double tol = UcGeContext::gTol.equalPoint()) const;
    double         paramAtLength(double datumParam, double length,
                                 ZSoft::Boolean posParamDir = ZSoft::kTrue,
                                 double tol = UcGeContext::gTol.equalPoint()) const;
    ZSoft::Boolean area         (double startParam, double endParam,
                                 double& value,
                                 const UcGeTol& tol = UcGeContext::gTol) const;

    ZSoft::Boolean isDegenerate(UcGe::EntityId& degenerateType,
                                const UcGeTol& tol = UcGeContext::gTol) const;
    ZSoft::Boolean isDegenerate(UcGeEntity2d*& pConvertedEntity,
                                const UcGeTol& tol = UcGeContext::gTol) const;

    void           getSplitCurves (double param, UcGeCurve2d* & piece1,
                                   UcGeCurve2d* & piece2) const;

	ZSoft::Boolean explode      (UcGeVoidPointerArray& explodedCurves,
	                             UcGeIntArray& newExplodedCurve,
				     const UcGeInterval* intrvl = NULL ) const;

    void getLocalClosestPoints(const UcGePoint2d& point,
                               UcGePointOnCurve2d& approxPnt,
                               const UcGeInterval* nbhd = 0,
                               const UcGeTol& = UcGeContext::gTol) const;
    void getLocalClosestPoints(const UcGeCurve2d& otherCurve,
                               UcGePointOnCurve2d& approxPntOnThisCrv,
                               UcGePointOnCurve2d& approxPntOnOtherCrv,
                               const UcGeInterval* nbhd1 = 0,
                               const UcGeInterval* nbhd2 = 0,
                               const UcGeTol& tol = UcGeContext::gTol) const;

    UcGeBoundBlock2d  boundBlock() const;
    UcGeBoundBlock2d  boundBlock(const UcGeInterval& range) const;

    UcGeBoundBlock2d  orthoBoundBlock() const;
    UcGeBoundBlock2d  orthoBoundBlock(const UcGeInterval& range) const;

    ZSoft::Boolean hasStartPoint(UcGePoint2d& startPoint) const;
    ZSoft::Boolean hasEndPoint  (UcGePoint2d& endPoint) const;

    UcGePoint2d    evalPoint(double param) const;
    UcGePoint2d    evalPoint(double param, int numDeriv,
                             UcGeVector2dArray& derivArray) const;

    void     getSamplePoints(double fromParam, double toParam,
                             double approxEps, UcGePoint2dArray& pointArray,
			     UcGeDoubleArray& paramArray) const;
    void     getSamplePoints(int numSample, UcGePoint2dArray&) const;

    UcGeCurve2d&   operator =  (const UcGeCurve2d& curve);

protected:

    UcGeCurve2d ();
    UcGeCurve2d (const UcGeCurve2d&);
};

#pragma pack (pop)
#endif
